package com.example.studentknowledgesys.service;

import com.example.studentknowledgesys.entity.PointRecord;
import com.example.studentknowledgesys.entity.PointRule;
import com.example.studentknowledgesys.entity.UserPoint;

import java.util.List;

/**
 * @author 光的代言人
 */
public interface PointService {
    // 积分规则管理
    PointRule createPointRule(PointRule pointRule);
    PointRule updatePointRule(PointRule pointRule);
    boolean deletePointRule(Integer id);
    List<PointRule> getAllPointRules();
    List<PointRule> getActivePointRules();

    // 用户积分管理
    UserPoint getUserPoint(Long userId);
    List<UserPoint> getTopUsers(int limit);

    // 积分记录管理
    List<PointRecord> getUserPointRecords(Long userId);
    List<PointRecord> getAllPointRecords();

    // 积分操作
    int awardPoints(Long userId, String ruleType, String description);
    int awardPoints(Long userId, String ruleType, int points, String description);

    PointRule getRuleByType(String ruleType);

    List<UserPoint> getAllUserPoints();
}